﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Fis.Service.Forms
{
    public partial class BackupForm : BaseForm
    {
        public BackupForm()
        {
            InitializeComponent();
        }

        public override void InitializeBinding()
        {
            Fis.Win.Utils.UIUtils.ClearBindings(layoutControl1);
            Fis.Win.Utils.UIUtils.TagBindings(layoutControl1, ViewModel["data"]);
        }

        public override void InitializeViewUI()
        {
            bar2.Visible = false;
        }

        private void bnNow_Click(object sender, EventArgs e)
        {
            ViewModel["Action"] = "exec";
            if (ViewProvider.ExecuteUpdate(ViewModel))
            {
                DevExpress.XtraEditors.XtraMessageBox.Show("执行成功");
            }
        }

        private void simpleButton2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            this.Validate();
            ViewModel["Action"] = "set";
            if (ViewProvider.ExecuteUpdate(ViewModel))
            {
                Close();
                return;
            }
        }
    }
}
